package models;

import java.util.List;

import siena.Column;
import siena.Generator;
import siena.Id;
import siena.Model;
import siena.Query;
import siena.Table;

@Table("tag")
public class Tag extends Model {

	@Id(Generator.AUTO_INCREMENT)
	public Long id;
	@Column("name")
	public String name;
	
	public static Query<Tag> all() {
		return Model.all(Tag.class);
	}
		
	public Tag(String name) {
		super();
		this.name = name;
	}



	public static Tag get(Long id) {
		return all().filter("id", id).get();
	}
	
	public static Tag get(String name) {
		return all().filter("name", name).get();
	}
}
